  
<!--购买--------------------------------------------------->
<div class="none " id="packlist">
<div class="Value_added">
	<div class="Value_added_mune">  
		<ul class="Value_added_mune_left">
			{yun:}foreach from=$packs item=v key=key{/yun}
			<li id="{yun:}$v.id{/yun}" {yun:}if $key==0{/yun} class="Value_added_mune_cur" {yun:}/if{/yun}><a href="javascript:void(0)" onclick="showleft('{yun:}$v.id{/yun}')">{yun:}$v.name{/yun}</a><i class="Value_added_bg"></i></li>
 			{yun:}/foreach{/yun}
		</ul>
	</div>
	<div class="Value_added_box"> 
    <div class="Value_added_box_av">
	<div class="clear"></div>
 		<table class="added_de_box_table" cellpadding="0" cellspacing="0">
			<tbody>
				<tr>
					<td><div style="width:458px;">套餐内容</div></td>
					<td><div>套餐价</div></td>
					<td><div>会员价格</div></td>
				</tr>
           	</tbody>
        </table>
    	<table class="added_de_box_table" cellpadding="0" cellspacing="0"id="ratinglist"></table>
		<form name="alipayment"  id="payform" action="../api/alipay/alipayto.php" method="post" target="_blank" onsubmit="return payforms();">
			<div class="added_de_box_fk">应付金额：
				<span class="added_de_box_fk_je" id="price">0</span> 元
			</div>
			{yun:}if $config.com_integral_online==1{/yun}
				<div class="added_de_box_fk">
					抵扣{yun:}$config.integral_pricename{/yun}：<input type="text" id="dkjf_tc" onkeyup="checkTcNum('{yun:}$statis.integral{/yun}','{yun:}$config.integral_proportion{/yun}');" oninput="myFunction(this)" style="width:80px;"class="job_recom_dktext">
				</div>
				<div class="added_de_box_fk">
					账户{yun:}$config.integral_pricename{/yun}：{yun:}$statis.integral{/yun}（1元 = {yun:}$config.integral_proportion{/yun}{yun:}$config.integral_pricename{/yun}）
				</div>
			{yun:}/if{/yun}

			<div class="added_de_box_fk dkh_div_tc" style="display:none">抵扣{yun:}$config.integral_pricename{/yun}后消费金额：
				<span class="added_de_box_fk_je" id="price_dk"></span> 元
			</div>

			<input type="hidden" id="comservice" value="">
			<div class="job_redpack_list">
				<div id="zftc_div">
				{yun:}if  $config.alipay=='1' || $config.wxpay=='1' {/yun}
					<div class="job_redpack_list_name">支付方式：</div>
					{yun:}if $config.wxpay=='1'{/yun}
		            <div class="job_redpack_pay">
		            	<a href="javascript:;" onclick="getOrder('wxpay');"><img src="{yun:}$com_style{/yun}/images/wx_pay.png"> 微信支付</a>
		            </div> 
		            {yun:}/if{/yun}
		            {yun:}if $config.alipay=='1'{/yun}
		            <div class="job_redpack_pay">
		            	<a href="javascript:;" onclick="getOrder('alipay');"><img src="{yun:}$com_style{/yun}/images/ap_pay.png"> 支付宝支付</a>
		            </div>
		            {yun:}/if{/yun}
		        {yun:}else{/yun}
		        	<div class="con_banner_no" style="width:300px;"><span></span><em>网站已关闭支付接口，请联系管理员</em></div>
	            {yun:}/if{/yun}
				</div>
				<div id="zftc_div2" style="display:none">
					<input type='button' value='确认支付' onClick="buytc_jfzf();" class='job_redpack_list_c_bth'>
				</div>
	            <input type="hidden" value="" id="pay_type" name="pay_type" value=''/>
				<input type="hidden" name="dingdan" id="order_id" value=""/>
				<input type="hidden" value="增值包"  name="subject" value=''/>
				<input type="hidden" name="pay_bank" value="directPay"> 
   	  		</div>
		</form>
  		
	</div>
</div>
</div></div>

<!--购买-------------------------------------------------end-->

<div style="display:none;" id="downresume_pay">
	<div class="job_recom_box">
		
		<div class="job_recom_list">
			<span class="job_recom_s">应付金额：</span>
			<div class="job_recom_list_jobtime">
				<div class="job_recom_list_jobtime_money">
					<span id="resume_price" class="job_recom_list_jobtime_s">{yun:}$config.integral_down_resume{/yun}</span>元
				</div>
			</div>
		</div>

		<!-- 可用积分抵扣 -->
		{yun:}if $config.com_integral_online==1{/yun}
			<div class="job_recom_list">
				<span class="job_recom_s">抵扣{yun:}$config.integral_pricename{/yun}：</span>
				<input type="text" value="" id="dkjf" name="dkjf" onkeyup="checkNum('{yun:}$statis.integral{/yun}','{yun:}$config.integral_proportion{/yun}');" oninput="myFunction(this)" style="width:80px;">
 			</div>
			<div class="job_recom_list">
				<span class="job_recom_s">账户{yun:}$config.integral_pricename{/yun}：</span>
 				{yun:}$statis.integral{/yun}（1元 = {yun:}$config.integral_proportion{/yun}{yun:}$config.integral_pricename{/yun}）
			</div>
		{yun:}/if{/yun}

		<div class="job_recom_list dkh_div" style="display:none">
			<span class="job_recom_s">抵扣后金额：</span>
			<div class="job_recom_list_jobtime">
				<div class="job_recom_list_jobtime_money">
					<span id="resum_price_dk" class="job_recom_list_jobtime_s"></span>元
				</div>
			</div>
		</div>

  		<form name="alipayment"  id="payform_downresume" action="../api/alipay/alipayto.php" method="post" target="_blank" onsubmit="return payforms();">
 			
			<div class="job_redpack_list">
				<div id="zf_div">
				{yun:}if  $config.alipay=='1' || $config.wxpay=='1' {/yun}
					<div class="job_redpack_list_name">支付方式：</div>
					{yun:}if $config.wxpay=='1'{/yun}
		            <div class="job_redpack_pay">
		            	<a href="javascript:;" onclick="getResume('wxpay');"><img src="{yun:}$com_style{/yun}/images/wx_pay.png"> 微信支付</a>
		            </div> 
		            {yun:}/if{/yun}
		            {yun:}if $config.alipay=='1'{/yun}
		            <div class="job_redpack_pay">
		            	<a href="javascript:;" onclick="getResume('alipay');"><img src="{yun:}$com_style{/yun}/images/ap_pay.png"> 支付宝支付</a>
		            </div>
		            {yun:}/if{/yun}
		        {yun:}else{/yun}
		        	<div class="con_banner_no" style="width:300px;"><span></span><em>网站已关闭支付接口，请联系管理员</em></div>
	            {yun:}/if{/yun}
				</div>
				<div id="zf_div2" style="display:none">
					<input type='button' value='确认支付' onClick="downresume_jfzf();" class='job_redpack_list_c_bth'>
				</div>


	            <input type="hidden" value="" id="pay_type" name="pay_type" value=''/>
				<input type="hidden" name="dingdan" id="order_downresume_id" value=""/>
				<input type="hidden" value="下载简历金额"  name="subject" value=''/>
				<input type="hidden" name="pay_bank" value="directPay"> 
   	  		</div>
		</form>
  	</div>
</div>

<!-- 面试邀请付费 -->
<div id="invite_server"  style="display:none;">
	<div class="job_recom_box">
 		<div class="job_recom_list">
			<span class="job_recom_s">所需金额：</span>
			<div class="job_recom_list_jobtime">
				<div class="job_recom_list_jobtime_money">
					<span id="need" class="job_recom_list_jobtime_s">{yun:}$config.integral_interview{/yun}</span>元
				</div>
			</div>
		</div>

		<!-- 可用积分抵扣 -->
		{yun:}if $config.com_integral_online==1{/yun}
			<div class="job_recom_list">
				<span class="job_recom_s">抵扣{yun:}$config.integral_pricename{/yun}：</span>
				<input type="text" value="" id="invite_dkjf" name="invite_dkjf" onkeyup="checkInviteNum('{yun:}$statis.integral{/yun}','{yun:}$config.integral_proportion{/yun}');" oninput="myFunction(this)" style="width:80px;" class="job_recom_text">
 			</div>
			<div class="job_recom_list">
				<span class="job_recom_s">账户{yun:}$config.integral_pricename{/yun}：</span>
 				<div class="job_recom_text_p">{yun:}$statis.integral{/yun}（1元 = {yun:}$config.integral_proportion{/yun}{yun:}$config.integral_pricename{/yun}）</div>
			</div>
		{yun:}/if{/yun}

		<div class="job_recom_list jfdkh_m" style="display:none">
			<span class="job_recom_s">抵扣后金额：</span>
			<div class="job_recom_list_jobtime">
				<div class="job_recom_list_jobtime_money">
					<span id="dkjfh" class="job_recom_list_jobtime_s"></span>元
				</div>
			</div>
		</div>
<div class="clear"></div>
		<div id="invite_zf_div">
			<form name="alipayment"  id="payform_invite" action="../api/alipay/alipayto.php" method="post" target="_blank" onsubmit="return payforms();">
				<div class="job_redpack_list mt10">
					{yun:}if $config.alipay=='1' || $config.wxpay=='1' {/yun}
						<div class="job_recom_s">支付方式：</div>
						{yun:}if $config.wxpay=='1' {/yun}
							<div class="job_redpack_pay">
								<a href="javascript:;" onclick="inviteOrder('wxpay');"><div class="job_redpack_pay_bor"><img src="{yun:}$com_style{/yun}/images/wx_pay.png"></div> 微信支付</a>
							</div> 
						{yun:}/if{/yun}
						{yun:}if $config.alipay=='1'{/yun}
							<div class="job_redpack_pay">
								<a href="javascript:;" onclick="inviteOrder('alipay');"><div class="job_redpack_pay_bor job_redpack_pay_bor_pd"><img src="{yun:}$com_style{/yun}/images/ap_pay.png"></div>支付宝支付</a>
							</div>
						{yun:}/if{/yun}
					{yun:}else{/yun}
						<div class="con_banner_no" style="width:300px;"><span></span><em>网站已关闭支付接口，请联系管理员</em></div>
					{yun:}/if{/yun}
					<input type="hidden" value="" id="pay_type" name="pay_type"/>
					<input type="hidden" name="dingdan" id="order_invite_id" value=""/>
					<input type="hidden" value="邀请面试金额"  name="subject"/>
					<input type="hidden" name="pay_bank" value="directPay">
				</div>
			</form>
		</div>
		<div id="invite_zf_btn" style="display:none">
			<input type='button' value='确认支付' onClick="qrzf();" class='job_redpack_list_c_bth'>
		</div>
	</div>
</div>


<!-- 猎头下载简历 -->
<div class="none " id="ltdownresume">
	<div class="job_recom_box">

		<div class="job_recom_list">
			<span class="job_recom_s">应付金额：</span>
			<div class="job_recom_list_jobtime">
				<div class="job_recom_list_jobtime_money">
					<span id="down_price" class="job_recom_list_jobtime_s">{yun:}$config.integral_lt_downresume{/yun}</span>元
				</div>
			</div>
		</div>

 		{yun:}if $config.com_integral_online==1{/yun}
			<div class="job_recom_list">
				<span class="job_recom_s">抵扣{yun:}$config.integral_pricename{/yun}：</span>
				<input type="text" value="" id="down_dkjf" name="down_dkjf" onkeyup="checkDownNum('{yun:}$statis.integral{/yun}','{yun:}$config.integral_proportion{/yun}');" oninput="myFunction(this)" style="width:80px;">
 			</div>
			<div class="job_recom_list">
				<span class="job_recom_s">账户{yun:}$config.integral_pricename{/yun}：</span>
 				{yun:}$statis.integral{/yun}（1元 = {yun:}$config.integral_proportion{/yun}{yun:}$config.integral_pricename{/yun}）
			</div>
		{yun:}/if{/yun}

		<div class="job_recom_list dkh_down_div" style="display:none">
			<span class="job_recom_s">抵扣后金额：</span>
			<div class="job_recom_list_jobtime">
				<div class="job_recom_list_jobtime_money">
					<span id="down_price_dk" class="job_recom_list_jobtime_s"></span>元
				</div>
			</div>
		</div>

  		<form name="alipayment"  id="payform_ltdownresume" action="../api/alipay/alipayto.php" method="post" target="_blank" onsubmit="return payforms();">

 			<div class="job_redpack_list">
				<div id="downzf_div">
				{yun:}if  $config.alipay=='1' || $config.wxpay=='1' {/yun}
					<div class="job_redpack_list_name">支付方式：</div>
					{yun:}if $config.wxpay=='1'{/yun}
		            <div class="job_redpack_pay">
		            	<a href="javascript:;" onclick="getDownResume('wxpay');"><img src="{yun:}$com_style{/yun}/images/wx_pay.png"> 微信支付</a>
		            </div> 
		            {yun:}/if{/yun}
		            {yun:}if $config.alipay=='1'{/yun}
		            <div class="job_redpack_pay">
		            	<a href="javascript:;" onclick="getDownResume('alipay');"><img src="{yun:}$com_style{/yun}/images/ap_pay.png"> 支付宝支付</a>
		            </div>
		            {yun:}/if{/yun}
		        {yun:}else{/yun}
		        	<div class="con_banner_no" style="width:300px;"><span></span><em>网站已关闭支付接口，请联系管理员</em></div>
	            {yun:}/if{/yun}
				</div>
				<div id="downzf_div2" style="display:none">
					<input type='button' value='确认支付' onClick="lt_downresume();" class='job_redpack_list_c_bth'>
				</div>


	            <input type="hidden" value="" id="pay_type" name="pay_type" value=''/>
				<input type="hidden" name="dingdan" id="order_ltdownresume_id" value=""/>
				<input type="hidden" value="下载简历金额"  name="subject" value=''/>
				<input type="hidden" name="pay_bank" value="directPay"> 
   	  		</div>
		</form>
  	</div>
</div>

<input type="hidden" name="orderid" id="orderid" value=""/>
<!--  微信tck-->
<div id="wxpayTx"  style="display:none;">
	<div class="wx_payment">
		<div class="wx_payment_cont"><div class="wx_payment_ewm">正在加载微信二维码,请稍候....</div> </div>
		<div class="wx_payment_h2">二维码有效时长为2小时，请尽快支付</div>
		<div class="wx_payment_tip">
			<div class="wx_payment_tip_left"><i class="wx_payment_tip_line1"></i><i class="wx_payment_tip_line2"></i><i class="wx_payment_tip_line3"></i></div> 
			<div class="wx_payment_tip_right">请使用微信扫一扫<br>扫描二维码支付</div>
		</div>
	</div>
</div>  
<!--支付弹出框-->
<div id="payshow" style="width:450px; position:absolute;left:0px;top:0px; background:#fff; display:none;">
	<div class="payment_tip">请在新打开的支付页面上完成付款，付款完成前请不要关闭此窗口。<br>如您在支付过程中遇到问题，请联系客服：<span class="payment_tip_s">{yun:}$config.sy_freewebtel{/yun}</span></div>
	<div class="payment_bottom">
		{yun:}if $usertype==2{/yun}
		<a href="{yun:}url m=resume c=show id=$Info.id{/yun}" class="payment_bottombutt">已完成付款</a>
		{yun:}else if $usertype==3{/yun}
		<a href="{yun:}url m=resume c=show id=$Info.id type=2{/yun}" class="payment_bottombutt">已完成付款</a>
		{yun:}/if{/yun}
 	</div>
</div>
 
<script>
//加减乘除
function accAdd(arg1,arg2){ 
	var r1,r2,m; 
	try{r1=arg1.toString().split(".")[1].length}catch(e){r1=0} 
	try{r2=arg2.toString().split(".")[1].length}catch(e){r2=0} 
	m=Math.pow(10,Math.max(r1,r2)) 
	return (arg1*m+arg2*m)/m 
} 
function accSub(arg1,arg2){ 
	return accAdd(arg1,-arg2); 
} 
function accMul(arg1, arg2) {
	var m = 0, s1 = arg1.toString(), s2 = arg2.toString();
	try { m += s1.split(".")[1].length } catch (e) { }
	try { m += s2.split(".")[1].length } catch (e) { }
	return Number(s1.replace(".", "")) * Number(s2.replace(".", "")) / Math.pow(10, m)
}
function accDiv(arg1,arg2){    
	var t1=0,t2=0,r1,r2;    
	try{t1=arg1.toString().split(".")[1].length}catch(e){}    
	try{t2=arg2.toString().split(".")[1].length}catch(e){}    
	with(Math){        
		r1=Number(arg1.toString().replace(".",""));        
		r2=Number(arg2.toString().replace(".",""));        
		return (r1/r2)*pow(10,t2-t1);    
	}
}
function myFunction(_this) {
	_this.value = _this.value.replace(/[^0-9]/g, '');
}

function checkTcNum(integral,integral_pro){
	var dkjf = $("#dkjf_tc").val();
 	if(dkjf){
		$(".dkh_div_tc").show();
	}else{
		$(".dkh_div_tc").hide();
	} 
	var price = $("#price").text();
	var need_jifen = accMul(price, integral_pro);
	if(parseInt(integral) >= parseInt(need_jifen)){
		if(parseInt(dkjf) > parseInt(need_jifen)){
			$("#dkjf_tc").val(need_jifen);
			var dkjfh = accSub(price , accDiv(need_jifen,integral_pro));
		}else{
			var dkjfh = accSub(price, accDiv(dkjf,integral_pro));
		}	
 	}else{
		if(parseInt(dkjf) > parseInt(integral)){
			$("#dkjf_tc").val(integral);
			var dkjfh = accSub(price , accDiv(integral,integral_pro));
		}else{
			var dkjfh = accSub(price, accDiv(dkjf,integral_pro));
 		}
 	}
  	if(dkjfh<=0){
		$("#price_dk").html(0);
		$("#zftc_div").hide();
		$("#zftc_div2").show();
	}else{
		$("#price_dk").html(dkjfh);
		$("#zftc_div").show();
		$("#zftc_div2").hide();
	} 
}

function buytc_jfzf(){//购买增值服务套餐（积分抵扣全部金额）
  	var index = layer.load('执行中，请稍候...',0);
	var tcid = $("#comservice").val();
 	var url = "{yun:}url m=resume c=show a=dkBuy{/yun}";
	$.post(url,{tcid:tcid},function(data){
		if(data){
			layer.closeAll();
			data=eval('('+data+')'); 
			if(data.error==1){
     			layer.msg(data.msg, 2,8);
     		}else if(data.error==0){
     			layer.msg(data.msg, 2,9,function(){
					window.location.href='{yun:}url m=resume c=show id=$smarty.get.id{/yun}';
				}); 
    		}
		}
	})
}

function checkNum(integral,integral_pro){
	var dkjf = $("#dkjf").val();
 	if(dkjf){
		$(".dkh_div").show();
	} 
	var resume_price = $("#resume_price").text();
	var need_jifen = accMul(resume_price, integral_pro);
	if(parseInt(integral) >= parseInt(need_jifen)){
		if(parseInt(dkjf) > parseInt(need_jifen)){
			$("#dkjf").val(need_jifen);
			var dkjfh = accSub(resume_price , accDiv(need_jifen,integral_pro));
		}else{
			var dkjfh = accSub(resume_price, accDiv(dkjf,integral_pro));
		}	
 	}else{
		if(parseInt(dkjf) > parseInt(integral)){
			$("#dkjf").val(integral);
			var dkjfh = accSub(resume_price , accDiv(integral,integral_pro));
		}else{
			var dkjfh = accSub(resume_price, accDiv(dkjf,integral_pro));
 		}
 	}
 	if(dkjfh<=0){
		$("#resum_price_dk").html(0);
		$("#zf_div").hide();
		$("#zf_div2").show();
	}else{
		$("#resum_price_dk").html(dkjfh);
		$("#zf_div").show();
		$("#zf_div2").hide();
	}
}

function downresume_jfzf(){//下载简历（积分抵扣全部金额）
  	var index = layer.load('执行中，请稍候...',0);
	var eid = $("#eid").val();
	var url = "{yun:}url m=resume c=show a=dkBuy{/yun}";
 	$.post(url,{eid:eid},function(data){
		if(data){
			layer.closeAll();
			data=eval('('+data+')'); 
			if(data.error==1){
     			layer.msg(data.msg, 2,8);
     		}else if(data.error==0){
     			layer.msg(data.msg, 2,9,function(){
					window.location.href='';
				}); 
    		}
		}
	})
}

function checkDownNum(integral,integral_pro){
	var dkjf = $("#down_dkjf").val();
 	if(dkjf){
		$(".dkh_down_div").show();
	} 
	var down_price = $("#down_price").text();
	var need_jifen = accMul(down_price, integral_pro);
 	if(parseInt(integral) >= parseInt(need_jifen)){
		if(parseInt(dkjf) > parseInt(need_jifen)){
			$("#down_dkjf").val(need_jifen);
			var dkjfh = accSub(down_price , accDiv(need_jifen,integral_pro));
		}else{
			var dkjfh = accSub(down_price, accDiv(dkjf,integral_pro));
		}	
 	}else{
		if(parseInt(dkjf) > parseInt(integral)){
			$("#down_dkjf").val(integral);
			var dkjfh = accSub(down_price , accDiv(integral,integral_pro));
		}else{
			var dkjfh = accSub(down_price, accDiv(dkjf,integral_pro));
 		}
 	}
	if(dkjfh<=0){
		$("#down_price_dk").html(0);
		$("#downzf_div").hide();
		$("#downzf_div2").show();
	}else{
		$("#down_price_dk").html(dkjfh);
		$("#downzf_div").show();
		$("#downzf_div2").hide();
	}
}

function lt_downresume(){//猎头下载简历（积分抵扣全部金额）
  	var index = layer.load('执行中，请稍候...',0);
	var eid = $("#eid").val();
	var url = "{yun:}url m=resume c=show a=dkBuy{/yun}";
 	$.post(url,{eid:eid},function(data){
		if(data){
			layer.closeAll();
			data=eval('('+data+')'); 
			if(data.error==1){
     			layer.msg(data.msg, 2,8);
     		}else if(data.error==0){
     			layer.msg(data.msg, 2,9,function(){
					window.location.href='';
				}); 
    		}
		}
	})
}

function checkInviteNum(integral,integral_pro){
	var dkjf = $("#invite_dkjf").val();
 	if(dkjf){
		$(".jfdkh_m").show();
	} 
	var need = $("#need").text();
	var need_jifen = accMul(need, integral_pro);

  	if(parseInt(integral) >= parseInt(need_jifen)){
		if(parseInt(dkjf) > parseInt(need_jifen)){
			$("#invite_dkjf").val(need_jifen);
			var dkjfh = accSub(need , accDiv(need_jifen,integral_pro));
		}else{
			var dkjfh = accSub(need, accDiv(dkjf,integral_pro));
		}	
 	}else{
		if(parseInt(dkjf) > parseInt(integral)){
			$("#invite_dkjf").val(integral);
			var dkjfh = accSub(need , accDiv(integral,integral_pro));
		}else{
			var dkjfh = accSub(need, accDiv(dkjf,integral_pro));
 		}
 	} 
	if(dkjfh<=0){
		$("#dkjfh").html(0);
		$("#invite_zf_div").hide();
		$("#invite_zf_btn").show();
	}else{
		$("#dkjfh").html(dkjfh);
		$("#invite_zf_div").show();
		$("#invite_zf_btn").hide();
	} 
}

function qrzf(){//邀请面试，积分全额抵扣购买
	var index = layer.load('执行中，请稍候...',0);
	var url = "{yun:}url m=resume c=show a=dkBuy{/yun}";
	$.post(url,{invite:1},function(data){
		if(data){
			layer.closeAll();
			data=eval('('+data+')'); 
			if(data.error==1){
     			layer.msg(data.msg, 2,8);
     		}else if(data.error==0){
     			layer.msg(data.msg, 2,9,function(){
					$.layer({
						type : 1,
						offset: ['100px', ''],
						title :'邀请面试', 
						closeBtn : [0 , true],
						border : [10 , 0.3 , '#000', true],
						area : ['380px','auto'],
						page : {dom :"#job_box"} 
					});
				}); 
    		}
		}
	})
}

function showleft(id){
	$("#dkjf_tc").val('');
	$(".dkh_div_tc").hide();
	$('#price').html(0);
	$('#comservice').val('');
	$("li").removeClass("Value_added_mune_cur");
	$('#'+id).addClass('Value_added_mune_cur');
	$.post('{yun:}url m=ajax c=getPack{/yun}',{id:id},function(data){
		$("#ratinglist").html(data);
 	});
}

function wxorderpaystatus(orderid) { 
	$.post('{yun:}url m=member c=payment act=wxpaystatus{/yun}',{orderid:orderid},function(data){
		if(data==1){
			window.location.href='';
		}
	});
}

function payforms(){
	var pay_type=$("#pay_type").val();

	if(pay_type==''){
		layer.msg('请选择支付方式！', 2,8);

	}else if(pay_type == 'wxpay'){ 

		var orderId = $("#orderid").val();
		
		$.post('{yun:}url m=member c=payment act=wxurl{/yun}',{orderId:orderId},function(data){
			
			$('.wx_payment_ewm').html(data);
			$.layer({
				type : 1,
				title :'微信扫码支付', 
				closeBtn : [0 , true],
				border : [10 , 0.3 , '#000', true],
				area : ['320px','400px'],
				page : {dom :"#wxpayTx"}
			});
			setInterval("wxorderpaystatus("+orderId+")", 3000); 
		})
		return false;  
	} else{
	
		$.layer({
			type : 1,
			title :'提示',
			closeBtn : [0 , true],
			border : [10 , 0.3 , '#000', true],
			area : ['450px','280px'],
			page : {dom :"#payshow"}
		});
	}
}
/* 选择增值包套餐，获取套餐ID 以及所需金额  */
function toChange(){
	$("#dkjf_tc").val('');
	$(".dkh_div_tc").hide();
	var obj  = document.getElementsByName('service_package');
    for(var i=0;i<obj.length;i++){
        if(obj[i].checked==true){
      		$('#comservice').val(obj[i].value);  
      		var comservinceid = obj[i].value; 
      		$.post('{yun:}url m=resume c=show a=getPrice{/yun}',{comservinceid:comservinceid},function(data){
          		if(data>0){
          			$('#price').html(data);
                }
       	 	});         
        }
    }
}

/*生成订单*/
function getOrder(pay_type){
	
	$('#pay_type').val(pay_type);
	
 	var tid = $("#comservice").val();//增值包选中套餐ID
 	
	var dkjf = $("#dkjf_tc").val();//增值包选中套餐ID

 	var price = document.getElementById("price").innerHTML;//选中套餐后所需要的金额

 	if(tid==""){
 		layer.msg('请选择增值包套餐！',2,8);return false;
 	}else{
 	 	
 		var index = layer.load('执行中，请稍候...',0);

 		$.ajax({
 	  		async: false, //设置ajax同步  
 	        type: 'POST',  
 	        global:false,
 	        url: "{yun:}url m=resume c=show a=pay{/yun}",  
 	        data: {tid:tid,price:price,dkjf:dkjf},  
 	        success: function(data){
            layer.close(index);
 	        	var data=eval('('+data+')'); 
            
 	        	if(data.error==1){
              layer.msg(data.msg, 2,8);
            }else if(data.error==0){
              $('#order_id').val(data.orderid);
              $('#orderid').val(data.id);
              //提交表单
              $('#payform').submit();
            }
 	        }
 	  	});
 	}
}

function getResume(pay_type){
	
	$('#pay_type').val(pay_type);
	
 	var eid = $("#eid").val();
	
	var dkjf = $("#dkjf").val();
 
	var index = layer.load('执行中，请稍候...',0);

	$.ajax({
 		async: false, //设置ajax同步  
 			type: 'POST',  
 			global:false,
 			url: "{yun:}url m=resume c=show a=pay{/yun}",  
 			data: {eid:eid,dkjf:dkjf},  
 			success: function(data){
				layer.close(index);
 				var data=eval('('+data+')'); 
           
 	       		if(data.error==1){
					layer.msg(data.msg, 2,8);
				}else if(data.error==0){
					$('#order_downresume_id').val(data.orderid);
					 $('#orderid').val(data.id);
					//提交表单
					$('#payform_downresume').submit();
				}
 	        }
 	  	});
 	 
}

function getDownResume(pay_type){
	
	$('#pay_type').val(pay_type);
	
 	var eid = $("#eid").val();
	
	var dkjf = $("#down_dkjf").val();
 
	var index = layer.load('执行中，请稍候...',0);

	$.ajax({
 		async: false, //设置ajax同步  
 			type: 'POST',  
 			global:false,
 			url: "{yun:}url m=resume c=show a=pay{/yun}",  
 			data: {eid:eid,down_dkjf:dkjf},  
 			success: function(data){
				layer.close(index);
 				var data=eval('('+data+')'); 
           
 	       		if(data.error==1){
					layer.msg(data.msg, 2,8);
				}else if(data.error==0){
					$('#order_ltdownresume_id').val(data.orderid);
					 $('#orderid').val(data.id);
					//提交表单
					$('#payform_ltdownresume').submit();
				}
 	        }
 	  	});
 	 
}

function inviteOrder(pay_type){//邀请面试
 	$('#pay_type').val(pay_type);
 	var dkjf = $('#invite_dkjf').val();
 	var index = layer.load('执行中，请稍候...',0);

 	$.ajax({
  		async: false, 
        type: 'POST',  
        global:false,
        url: "{yun:}url m=resume c=show a=pay{/yun}",  
        data: {invite:1,dkjf:dkjf},  
        success: function(data){  
          layer.close(index);
        	var data=eval('('+data+')'); 
          
        	if(data.error==1){
     			layer.msg(data.msg, 2,8);
     		}else if(data.error==0){
     			$('#order_invite_id').val(data.orderid);
    			$('#orderid').val(data.id);
    			//提交表单
    			$('#payform_invite').submit();
    		}
        }  
  	});
}
</script>
